import request from '@/utils/request';

// 查询商品规格参数列表
export function listNorms(query) {
	return request({
		url: '/system/norms/list',
		method: 'post',
		data: query,
	});
}
// 查询商品规格参数列表
export function allListNorms(query) {
	return request({
		url: '/system/norms/allList',
		method: 'post',
		data: query,
	});
}
// 查询商品规格参数列表
export function allListNormsByAdmin(query) {
	return request({
		url: '/system/norms/allListByAdmin',
		method: 'post',
		data: query,
	});
}

// 查询商品规格参数详细
export function getNorms(id) {
	return request({
		url: '/system/norms/getInfo',
		method: 'post',
		data: id,
	});
}

// 新增商品规格参数
export function addNorms(data) {
	return request({
		url: '/system/norms/add',
		method: 'post',
		data: data,
	});
}

// 编辑商品规格参数
export function updateNorms(data) {
	return request({
		url: '/system/norms/edit',
		method: 'post',
		data: data,
	});
}

// 删除商品规格参数
export function delNorms(id) {
	return request({
		url: '/system/norms/remove',
		method: 'post',
		data: { id: id },
	});
}

// 导出商品规格参数
export function exportNorms(query) {
	return request({
		url: '/system/norms/export',
		method: 'post',
		params: query,
	});
}
export const sortOrderReduce = (id) => {
	return request({
		url: '/system/norms/reSortOrderReduce',
		method: 'post',
		data: id,
	});
};
export const sortOrderPlus = (id) => {
	return request({
		url: '/system/norms/reSortOrderPlus',
		method: 'post',
		data: id,
	});
};
